package com.rainng.coursesystem.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.rainng.coursesystem.dao.mapper.CourseResourceMapper;
import com.rainng.coursesystem.model.entity.CourseResourceEntity;
import com.rainng.coursesystem.model.vo.response.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CourseResourceService extends BaseService{


    @Autowired
    private CourseResourceMapper courseResourceMapper;

    public ResultVO getResource(Integer courseId) {
        QueryWrapper<CourseResourceEntity> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("course_id",courseId);
        List<CourseResourceEntity> list = courseResourceMapper.selectList(queryWrapper);
        return result(list);
    }
}
